﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UndertakingForm.aspx.cs"
    Inherits="Trig_AMJ_HR_Forms.Layouts.Trig_AMJ_HR_Forms.Undertaking_Form" DynamicMasterPageFile="~masterurl/default.master" %>

<%@ Register TagPrefix="trig" TagName="userInfo" Src="~/_controltemplates/Trig_AMJ_IT_Forms/UserProfileInfo.ascx" %>
<%@ Register TagPrefix="trig" TagName="UtakingComments" Src="~/_controltemplates/Trig_AMJ_AMG_Forms/TrigAMJFormsComments/TrigAMJFormsCommentsUserControl.ascx" %>
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link rel="Stylesheet" type="text/css" href="/_layouts/1033/STYLES/Themable/FORMS.CSS" />
    <link rel="Stylesheet" type="text/css" href="/_layouts/1033/STYLES/AMG_FormsStyles/Customformcss.css" />
    <script language="javascript" type="text/ecmascript" src="/_layouts/Scripts/validation.js"></script>
    <style type="text/css">
        #s4-leftpanel
        {
            display: none;
        }
        .s4-ca
        {
            margin-left: 0px;
        }
        .ms-validations
        {
            color: Red;
        }
        .style2
        {
            width: 373px;
        }
        .style3
        {
            width: 366px;
        }
        body, td, th
        {
            font-size: 8pt;
            font-family: Verdana, Arial, sans-serif;
        }
        .empt_td td
        {
            padding: 10px 0;
        }
    </style>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <asp:Panel ID="pnlFullForm" runat="server" CssClass="pnlWhole">
        <table cellpadding="0" cellspacing="0" width="950px" class="tblWhole">
            <tr>
                <td colspan="4" class="tdHeadingTextCenterAlign">
                    Undertaking Form
                </td>
            </tr>
            <tr>
                <td class="tdCell" colspan="1">
                    Reference No :
                </td>
                <td width="500px" colspan="2">
                    <asp:Label ID="lblUtReqNo" runat="server" Text="Reference number will be generated upon save"
                        Font-Bold="True" Font-Size="XX-Small" CssClass="ms-long ms-spellcheck-true" ForeColor="Red"></asp:Label>
                </td>
                <td align="right" rowspan="2">
                    <trig:userInfo runat="server" ID="userInfo" Visible="true" />
                </td>
            </tr>
            <tr>
                <td class="tdCell" colspan="1">
                    Date of filling :
                </td>
                <td width="500px" colspan="2">
                    <SharePoint:DateTimeControl ID="dtpDate" runat="server" DateOnly="true" IsRequiredField="true"
                        LocaleId="2057" Enabled="false" ErrorMessage="Please specify the date" />
                </td>
            </tr>
            <tr>
                <td colspan="4" class="tdHeadingTextLeftAlign">
                    Leave Information
                </td>
            </tr>
            <tr>
                <td colspan="4" class="tdCell">
                    <asp:Panel ID="pnlSec" runat="server">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td rowspan="4" colspan="1" width="300x" valign="top" style="padding: 6px">
                                    <asp:RadioButtonList ID="rdBtn" AutoPostBack="true" runat="server" OnSelectedIndexChanged="rdBtn_SelectedIndexChanged"
                                        RepeatDirection="Horizontal" RepeatLayout="Flow">
                                        <asp:ListItem Text="Logged in User" Value="0" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="On Behalf of" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                                <td colspan="3">
                                    Leave Type :
                                </td>
                                <td colspan="3">
                                    <asp:RadioButtonList runat="server" ID="rdBtnLeaveType" RepeatDirection="Horizontal"
                                        Enabled="false" AutoPostBack="true">
                                        <asp:ListItem Text="Annual" Value="0" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="Emergency" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="Cancellation" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Others" Value="3"></asp:ListItem>
                                    </asp:RadioButtonList>
                                    <div id="divLeaveOth" runat="server" style="padding-left: 22px" visible="false">
                                        <asp:TextBox runat="server" ID="txtLeaveOthers" Width="304px" align="right" Enabled="false"></asp:TextBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    Eligible for vacation :
                                </td>
                                <td colspan="3">
                                    <asp:RadioButtonList runat="server" ID="rdBtnEligible" RepeatDirection="Horizontal"
                                        Enabled="false">
                                        <asp:ListItem Text="Yes" Value="0" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="No" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td width="250px" colspan="3">
                                    Airticket borne by employee :
                                </td>
                                <td colspan="3">
                                    <asp:RadioButtonList runat="server" ID="rdBtnAirTkt" RepeatDirection="Horizontal"
                                        Enabled="false">
                                        <asp:ListItem Text="Yes" Value="0" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="No" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <asp:UpdatePanel runat="server" ID="uptReqEmp">
                <ContentTemplate>
                    <asp:Panel ID="pnlReqEmpInf" runat="server" Visible="false">
                        <tr>
                            <td class="tdHeadingTextLeftAlign" colspan="4">
                                Requested Employee Information
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                Name :<span title="This is a required field." class="ms-validations"><strong>*</strong></span>
                            </td>
                            <td class="tdCell">
                                <SharePoint:PeopleEditor ID="pplReqUser" runat="server" MultiSelect="false" AutoPostBack="true"
                                    Width="250px" />
                                <asp:TextBox ID="txtReqUser" runat="server" ReadOnly="true" Width="250px" Visible="false"
                                    Enabled="false"></asp:TextBox>
                            </td>
                            <td class="tdCell">
                                Employee ID :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtReqEmpId" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                Division :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtReqDivision" runat="server" Width="250px" ReadOnly="true"></asp:TextBox>
                            </td>
                            <td class="tdCell">
                                Designation :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtReqDesignation" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                Mobile Number :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtReqMobileNo" runat="server" Width="250px" onkeypress="return isNumberKey(this)"></asp:TextBox>
                            </td>
                        </tr>
                    </asp:Panel>
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="rdBtn" />
                </Triggers>
            </asp:UpdatePanel>
            <asp:UpdatePanel runat="server" ID="uptLeaveCk">
                <ContentTemplate>
                    <asp:Panel ID="pnlLeaveCk" runat="server">
                        <tr>
                            <td class="tdHeadingTextLeftAlign" colspan="4">
                                Approved Leave Request Details
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell" width="160px">
                                Reference Number:
                            </td>
                            <td class="tdCell">
                                <asp:Label runat="server" ID="lblLeaveRefNo" Font-Bold="True" Font-Size="XX-Small"
                                    CssClass="ms-long ms-spellcheck-true" ForeColor="Red"></asp:Label>
                            </td>
                            <td class="tdCell" width="160px">
                                Request Date :
                            </td>
                            <td class="tdCell">
                                <SharePoint:DateTimeControl runat="server" ID="dtLeaveReqDt" DateOnly="true" LocaleId="2057"
                                    Enabled="False" />
                            </td>
                        </tr>
                        <tr>
                            <td class="tdHeadingTextLeftAlign" colspan="4">
                                Employment
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell" width="160px">
                                Date of Employment :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtDOJ" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                            <td class="tdCell" width="160px">
                                No.of years employed :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtExpYear" runat="server" Width="125px" ReadOnly="true"></asp:TextBox><span>
                                    yy:mm:wk:days</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                Passport Number :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtPassNo" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                            <td class="tdCell">
                                Passport Expiry :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtPassExpire" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                Qatar ID Number :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtQatariID" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                            <td class="tdCell">
                                Qatar ID Expiry :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtQatarIDExpire" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                Nationality :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtNationality" runat="server" ReadOnly="true" Width="250px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdHeadingTextLeftAlign" colspan="4">
                                Vacation Details
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                Travel Date : <span title="This is a required field." class="ms-validations"><strong>
                                    *</strong></span>
                            </td>
                            <td class="tdCell">
                                <SharePoint:DateTimeControl runat="server" ID="dtTravelDt" DateOnly="true" LocaleId="2057"
                                    Enabled="False" />
                                <asp:Label runat="server" ID="lblTravelDt" Width="250px" Font-Bold="true" Font-Size="X-Small"
                                    ForeColor="Red"></asp:Label>
                            </td>
                            <td class="tdCell">
                                Return Date: <span title="This is a required field." class="ms-validations"><strong>
                                    *</strong></span>
                            </td>
                            <td class="tdCell">
                                <SharePoint:DateTimeControl runat="server" ID="dtReturnDt" DateOnly="true" LocaleId="2057"
                                    Enabled="False" />
                                <asp:Label runat="server" ID="lblReturnDt" Width="250px" Font-Bold="true" Font-Size="X-Small"
                                    ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdCell">
                                No. of days :
                            </td>
                            <td class="tdCell">
                                <asp:TextBox ID="txtLeaveDays" runat="server" ReadOnly="true" Width="250px" Enabled="false"
                                    EnableViewState="true"></asp:TextBox>
                            </td>
                            <td class="tdCell">
                                Work Endorsed to : <span title="This is a required field." class="ms-validations"><strong>
                                    *</strong></span>
                            </td>
                            <td class="tdCell">
                                <SharePoint:DateTimeControl runat="server" ID="dtWorkEOD" DateOnly="true" LocaleId="2057"
                                    Enabled="False" />
                                <asp:Label runat="server" ID="lblWorkEOD" Width="250px" Font-Bold="true" Font-Size="X-Small"
                                    ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                    </asp:Panel>
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="rdBtn" />
                </Triggers>
            </asp:UpdatePanel>
            <tr>
                <td class="tdHeadingTextLeftAlign" colspan="4">
                    Vacation History
                </td>
            </tr>
            <tr runat="server" id="trVacationDetails" visible="false">
                <td colspan="4" align="center">
                    <asp:Label runat="server" ID="lblVacationDetails" Text="" Font-Size="X-Small" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <asp:Panel ID="pnlgvVacations" runat="server" align="center">
                <tr>
                    <td colspan="4" align="center" style="padding: 5px 5px 5px 5px">
                        <asp:GridView ID="gvVacationDetails" runat="server" AutoGenerateColumns="false">
                            <Columns>
                                <asp:TemplateField HeaderText="Travel Date">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" ID="txtLeaveDt" Text='<%# Eval("RequestDate", "{0:dd-MM-yyyy}") %>'
                                            Width="200px" ReadOnly="true"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Leave Type">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" ID="txtLeaveType" Text='<%# Bind("LeaveType") %>' Width="200px"
                                            ReadOnly="true"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Resumption Date">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" ID="txtResumptionDt" Text='<%# Eval("ResumptionDate", "{0:dd-MM-yyyy}") %>'
                                            Width="200px" ReadOnly="true"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Ticket Paid By">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" ID="txtTicketPaidBy" Text='<%# Bind("TicketPaidBy") %>'
                                            Width="200px" ReadOnly="true"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </asp:Panel>
            <asp:Panel ID="pnlCommentArea" runat="server">
                <tr>
                    <td colspan="4" class="tdHeadingTextLeftAlign">
                        <strong>Comments</strong><span class="ms-validations" title="This is a required field."><strong>
                            *</strong></span>
                    </td>
                </tr>
                <tr>
                    <td class="tdCell" width="150px">
                        <asp:Image ID="ImgUser" runat="server" Height="50px" Width="50px" />
                        <br />
                        <asp:Label ID="LblCommentsUserName" runat="server" Font-Bold="True" Font-Size="XX-Small"
                            ForeColor="#003399" Text=""></asp:Label>
                    </td>
                    <td colspan="3" class="tdCell">
                        <asp:TextBox ID="TxtComments" runat="server" TextMode="MultiLine" Width="600px"></asp:TextBox>
                    </td>
                </tr>
            </asp:Panel>
            <tr id="upAtt" runat="server">
                <td class="tdCell" width="150px">
                    Upload Attachment
                </td>
                <td colspan="3" class="tdCell">
                    <asp:FileUpload ID="upfile" runat="server" CssClass="ms-fileinput" Width="250px" />
                </td>
            </tr>
            <tr>
                <td colspan="4" style="padding: 10px;">
                    <trig:UtakingComments ID="UtComments" runat="server" />
                </td>
            </tr>
            <asp:Panel ID="pnlForward" runat="server" Visible="false">
                <tr>
                    <td colspan="4" style="text-align: left; background-color: #121e66; color: #ffffff;
                        font-weight: bold; padding: 10px;">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <asp:RadioButton ID="rtbSendBack" runat="server" Text="Send Back" GroupName="Users"
                                                AutoPostBack="true" onclick="javascript:fnSendBackUsers(this)" />
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="rtbSendBack" EventName="CheckedChanged" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                </td>
                                <td>
                                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                        <ContentTemplate>
                                            <asp:RadioButton ID="rtbForwardOthers" runat="server" Text="Forward to other user"
                                                AutoPostBack="true" GroupName="Users" onclick="javascript:fnForwardUsers(this)" />
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="rtbForwardOthers" EventName="CheckedChanged" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                </td>
                                <td>
                                    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                        <ContentTemplate>
                                            <asp:RadioButton ID="rtbForward" runat="server" Text="Forward" GroupName="Users"
                                                AutoPostBack="true" onclick="javascript:fnForword(this)" />
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="rtbForward" EventName="CheckedChanged" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                                        <ContentTemplate>
                                            <asp:Label ID="lblWFStaticUser" runat="server" Text="" Font-Bold="True" Font-Size="XX-Small"
                                                ForeColor="Yellow"></asp:Label>
                                            <asp:Label ID="lblSendBacktoUser" runat="server" Text="" Font-Bold="True" Font-Size="XX-Small"
                                                ForeColor="Yellow" Visible="false"></asp:Label>
                                            <asp:Label ID="lblsendBackUserValue" runat="server" Text="" Font-Bold="True" Font-Size="XX-Small"
                                                ForeColor="Yellow"></asp:Label>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr style="padding: 10px; display: none" id="trotherUsers">
                    <td style="padding: 10px; font-weight: bold; color: #121e66;" width="130px">
                        User Name :
                    </td>
                    <td style="padding: 10px;" colspan="3">
                        <asp:Label ID="lblCNTSectionMsg" runat="server" Text=""></asp:Label>
                        <SharePoint:PeopleEditor ID="pplcnt" runat="server" MultiSelect="false" AllowEmpty="false"
                            Width="250px" ForeColor="Red" AutoPostBack="false" />
                    </td>
                </tr>
            </asp:Panel>
            <tr>
                <td colspan="4" class="lblErrorMsg">
                    <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                        <ContentTemplate>
                            <asp:Label ID="lblError" runat="server" Font-Bold="True" Font-Size="XX-Small" ForeColor="Red"
                                Text=""></asp:Label>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td colspan="4" class="tblButtons" style="padding-top: 5px;">
                    <asp:Button ID="btnSubmit" runat="server" CssClass="ms-ButtonHeightWidth" Text="Submit"
                        OnClientClick="javascript:return fnValidation();" />
                    <asp:Button ID="btnApprove" runat="server" CssClass="ms-ButtonHeightWidth" Text="Approve"
                        OnClientClick="javascript:return fnValidation();" Visible="false" />
                    <asp:Button ID="btnReject" runat="server" CssClass="ms-ButtonHeightWidth" Text="Reject"
                        Visible="false" OnClientClick="javascript:return fnValidation();" />
                    <input id="btnCancel" class="ms-ButtonHeightWidth" type="button" value="Close" accesskey="C"
                        onclick="window.parent.history.back()" runat="server" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="pnlAccessDenied" runat="server" Visible="false">
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td style="text-align: center;">
                    <asp:Label ID="lblAccessDeniedMsg" runat="server" Text="" Font-Size="Medium" ForeColor="Red"
                        Font-Bold="True" Visible="false"></asp:Label>
                    <asp:Label ID="lblUserNotvailable" runat="server" Text="" Font-Size="Medium" ForeColor="Red"
                        Font-Bold="True" Visible="false"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="text-align: center; padding-top: 10px;">
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/_layouts/1033/IMAGES/IRForm/AccessDeniedImage.png" />
                </td>
            </tr>
            <tr>
                <td style="text-align: center; padding-top: 10px">
                    <input id="butonclose" class="ms-ButtonHeightWidth" type="button" onclick="window.parent.history.back()"
                        value="Close" accesskey="C" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <script language="javascript" type="text/javascript">


        function fnForwardUsers(obj) {
            if (obj.checked == true)
                document.getElementById("trotherUsers").style.display = "inline";
            else
                document.getElementById("trotherUsers").style.display = "none";

        }

        function fnSendBackUsers(obj) {
            if (obj.checked == true)
                document.getElementById("trotherUsers").style.display = "none";
        }
        function fnForword(obj) {
            if (obj.checked == true)
                document.getElementById("trotherUsers").style.display = "none";
        }
    </script>
    <script language="javascript" type="text/javascript">

        function Trim(TrimString) {
            var tempObj;
            if (TrimString) { tempObj = TrimString; TrimString = tempObj.value; }
            if (TrimString == "undefined" || TrimString == null) return null;
            if (TrimString.length == 0) TrimString = "";
            else {
                var Lcont = 0, TempStrArray = TrimString.split(" "), Rcont = TempStrArray.length - 1;
                while (TempStrArray[Lcont] == "") Lcont++; while (TempStrArray[Rcont] == "") Rcont--;
                if (Rcont < Lcont) TrimString = ""; else
                    for (TrimString = TempStrArray[Lcont], Lcont++; Lcont <= Rcont; Lcont++) TrimString += " " + TempStrArray[Lcont];
                var re = /\'|/g;
                TrimString = TrimString.replace(re, "");
            }
            if (tempObj && TrimString != "undefined" && TrimString != null)
            { tempObj.value = TrimString; return tempObj }
            else return TrimString;
        }
        function fnValidation() {
            debugger;
            var rval = true;
            var ErrorMsg = "";
            var objFocus;

            Trim(document.getElementById('<%= TxtComments.ClientID  %>'));

            if (document.getElementById('<%= TxtComments.ClientID  %>').value == "") {
                ErrorMsg = "Fields marked with (*) cannot be left blank";
                objFocus = document.getElementById('<%= TxtComments.ClientID  %>');
                rval = false;
            }
            if (rval == false) {
                document.getElementById('<%= lblError.ClientID  %>').innerHTML = ErrorMsg;
                objFocus.focus();
            }
            return rval;
        }
    </script>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    Undertaking Form
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    Undertaking Form
</asp:Content>
